package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import com.ruoyi.system.api.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 字典服务
 *
 * @author zj
 */
@FeignClient(contextId = "remoteDictDataService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteDictDataService
{
    /**
     * 根据字典类型和字典键值查询字典数据信息
     *
     * @param dictType 字典类型
     * @param dictValue 字典键值
     * @return 字典标签
     */
    @GetMapping("/dict/data/getDictLabel/{dictType}/{dictValue}")
    public R<String> getDictLabel(@PathVariable("dictType") String dictType, @PathVariable("dictValue") String dictValue,
                                  @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/dict/data/getDictLabelNew/{dictType}/{dictValue}")
    public R<String> getDictLabelNew(@PathVariable("dictType") String dictType, @PathVariable("dictValue") String dictValue);


    @GetMapping("/dict/data/getDictValue/{dictType}/{dictLabel}")
    public R<Object> getDictValue(@PathVariable("dictType") String dictType, @PathVariable("dictLabel") String dictLabel);
}
